﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Okuma.CLDATAPI.DataAPI;
using Okuma.CLDATAPI.Enumerations;
using OpenNETCF.MTConnect;

namespace Okuma
{
    public class Workpiece : ToolPart
    {
        private CWorkpiece m_workpiece;

        internal Workpiece(SubSystemEnum subSystem)
            : base(subSystem)
        {
            m_workpiece = new CWorkpiece(subSystem);
        }

        public override string Name
        {
            get { return "Workpiece"; }
        }

        public override ComponentType  ComponentType
        {
            get { return ComponentType.Workpiece; }
        }

        [EventDataItem(
            ItemType = DataItemType.PART_COUNT)]
        public int WorkpieceCountA
        {
            get { return m_workpiece.GetWorkpieceCounter(WorkpieceCounterEnum.CounterA); }
        }

        [EventDataItem(
            ItemType = DataItemType.PART_COUNT)]
        public int WorkpieceCountB
        {
            get { return m_workpiece.GetWorkpieceCounter(WorkpieceCounterEnum.CounterB); }
        }

        [EventDataItem(
            ItemType = DataItemType.PART_COUNT)]
        public int WorkpieceCountC
        {
            get { return m_workpiece.GetWorkpieceCounter(WorkpieceCounterEnum.CounterC); }
        }

        [EventDataItem(
            ItemType = DataItemType.PART_COUNT)]
        public int WorkpieceCountD
        {
            get { return m_workpiece.GetWorkpieceCounter(WorkpieceCounterEnum.CounterD); }
        }
    }
}
